<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数据采集</title>
    <link rel="stylesheet" href="./layui/css/layui.css">
    <style>
        body {
            background-color: #f5f5f5;
            padding: 20px;
        }
        
        .layui-card {
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
            border-radius: 4px;
        }
        
        .layui-form-item {
            margin-bottom: 20px;
        }
        
        .layui-form-label {
            width: 120px;
        }
        
        .layui-input-block {
            margin-left: 150px;
        }
    </style>
</head>
<body>
    <div class="layui-container">
        <div class="layui-card">
            <div class="layui-card-header">数据采集</div>
            <div class="layui-card-body">
                <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                    <ul class="layui-tab-title">
                        <li class="layui-this">路口数据录入</li>
                        <li>优化记录录入</li>
                    </ul>
                    <div class="layui-tab-content">
                        <!-- 路口数据录入表单 -->
                        <div class="layui-tab-item layui-show">
                            <form class="layui-form" action="">
                                <div class="layui-collapse">
                                    <div class="layui-colla-item">
                                        <h2 class="layui-colla-title">基础信息</h2>
                                        <div class="layui-colla-content layui-show">
                                            <div class="layui-form-item">
                                                <label class="layui-form-label">路口名称</label>
                                                <div class="layui-input-block">
                                                    <input type="text" name="title" required lay-verify="required" placeholder="请输入路口名称" autocomplete="off" class="layui-input">
                                                </div>
                                            </div>
                                            <div class="layui-form-item">
                                                <label class="layui-form-label">路口类型</label>
                                                <div class="layui-input-block">
                                                    <select name="type" lay-verify="required">
                                                        <option value=""></option>
                                                        <option value="0">十字路口</option>
                                                        <option value="1">T字路口</option>
                                                        <option value="2">环岛路口</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="layui-form-item">
                                                <label class="layui-form-label">所在位置</label>
                                                <div class="layui-input-block">
                                                    <input type="text" name="location" placeholder="请输入路口位置" autocomplete="off" class="layui-input">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    
                                    <div class="layui-colla-item">
                                        <h2 class="layui-colla-title">交通配置</h2>
                                        <div class="layui-colla-content">
                                            <div class="layui-form-item">
                                                <label class="layui-form-label">车道数量</label>
                                                <div class="layui-input-block">
                                                    <input type="number" name="lane_count" placeholder="请输入车道数量" autocomplete="off" class="layui-input">
                                                </div>
                                            </div>
                                            <div class="layui-form-item">
                                                <label class="layui-form-label">信号灯配置</label>
                                                <div class="layui-input-block">
                                                    <input type="text" name="signal_config" placeholder="请输入信号灯配置信息" autocomplete="off" class="layui-input">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    
                                    <div class="layui-colla-item">
                                        <h2 class="layui-colla-title">流量数据</h2>
                                        <div class="layui-colla-content">
                                            <div class="layui-form-item">
                                                <label class="layui-form-label">高峰时段</label>
                                                <div class="layui-input-block">
                                                    <input type="text" name="peak_hours" placeholder="请输入高峰时段" autocomplete="off" class="layui-input">
                                                </div>
                                            </div>
                                            <div class="layui-form-item">
                                                <label class="layui-form-label">平均车流量</label>
                                                <div class="layui-input-block">
                                                    <input type="number" name="avg_traffic" placeholder="请输入平均车流量(辆/小时)" autocomplete="off" class="layui-input">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                
                                <div class="layui-form-item">
                                    <div class="layui-input-block">
                                        <button class="layui-btn" lay-submit lay-filter="dataSubmit">提交</button>
                                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                        
                        <!-- 优化记录录入表单 -->
                        <div class="layui-tab-item">
                            <form class="layui-form" action="">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">优化日期</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="optimize_date" id="optimize_date" placeholder="请选择日期" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">优化人员</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="optimizer" required lay-verify="required" placeholder="请输入优化人员姓名" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">优化内容</label>
                                    <div class="layui-input-block">
                                        <textarea name="content" placeholder="请输入优化内容描述" class="layui-textarea"></textarea>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">优化效果</label>
                                    <div class="layui-input-block">
                                        <textarea name="effect" placeholder="请输入优化效果评估" class="layui-textarea"></textarea>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-input-block">
                                        <button class="layui-btn" lay-submit lay-filter="recordSubmit">提交</button>
                                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="./layui/layui.js"></script>
    <script>
        layui.use(['element', 'form', 'laydate'], function(){
            var element = layui.element;
            var form = layui.form;
            var laydate = layui.laydate;
            
            // 日期选择器
            laydate.render({
                elem: '#optimize_date'
            });
            
            // 路口数据表单提交
            form.on('submit(dataSubmit)', function(data){
                layer.msg('路口数据提交成功');
                return false;
            });
            
            // 优化记录表单提交
            form.on('submit(recordSubmit)', function(data){
                layer.msg('优化记录提交成功');
                return false;
            });
        });
    </script>
</body>
</html>